<?php

require '../conn.php';

require 'config.php';

require '../inc/function.php';

$query=mysql_query('select * from '.$language.'_config where s_id=1');

$row=mysql_fetch_array($query);

 

$query=mysql_query('select * from '.$language.'_config where s_id=1');

$row=mysql_fetch_array($query);

$site_name=$row['s_name'];

$site_domain=$row['s_domain'];

$site_keyword=$row['s_keyword'];

$site_description=$row['s_description'];

$site_copyright=$row['s_copyright'];


$site_description=$row['s_description'];

	$site_copyright=$row['s_copyright'];

	$site_tel=$row['s_tel'];

	$site_tdc=$row['s_tdc'];
	$site_fax=$row['s_fax'];
	$site_email=$row['s_email'];
	$site_address=$row['s_address'];
	$site_ico1=$row['s_ico1'];
	$site_ico2=$row['s_ico2'];
	$site_ico3=$row['s_ico3'];
	$site_ico4=$row['s_ico4'];
	$site_ico5=$row['s_ico5'];

 
$site_soc=$row['s_soc'];

$site_soc2=$row['s_soc2'];

$site_soc2_code=$row['s_soc2_code'];

$site_stat=$row['s_stat'];

$site_stat_code=$row['s_stat_code'];

$site_name2=$row['s_name'];

$site_names=$row['s_name'];

$site_keyword2=$row['s_keyword'];

$site_description2=$row['s_description'];

if ($id<=10){

	$query=mysql_query('select * from '.$language.'_keywords where k_id='.$id);

	$row=mysql_fetch_array($query);

	if ($row['k_name']!='') $site_name=$row['k_name'];

	if ($row['k_keyword']!='') $site_keyword=$row['k_keyword'];

	if ($row['k_description']!='') $site_description=$row['k_description'];

 
}



$language_path='';

	$language_paths='';
 
	$pn_str1='上一页: ';

	$pn_str2='下一页: ';

	$pn2_str1='上一页: ';

	$pn2_str2='下一页: ';

	$pn_str3='Volver';

	$pn_str4='';

$file_path='../'.$language_path;

switch($id){

case 1:
$ye="index";

	$file_name=$file_path.'index.html';

 
	$content=include('html_header.php');
	
	$content.='<div class="flexslider">
                <ul class="slides">';
            
                $query=mysql_query('select * from '.$language.'_ad order by a_order,a_id');
            
                if (mysql_num_rows($query)>0){
            
                while ($row=mysql_fetch_array($query)){
                 if($row['a_url']=='') {
                $content.='<li style="background:url('.$row['a_image'].') 50% 0 no-repeat;"></li>';
				 }
				 else
				 {
				$content.='<li style="background:url('.$row['a_image'].') 50% 0 no-repeat;"><a href="'.$row['a_url'].'"><div class="divad"></div></a></li>';
 
					 }
                }
                
				 }
            
            $content.=' </ul>
</div>
<!-- 代码end -->
<!-- js调用部分begin -->
<script src="js/jquery.flexslider-min.js"></script>
<script>
$(function(){
	$(\'.flexslider\').flexslider({
		directionNav: true,
		pauseOnAction: false
	});
});
</script>


 <div id="iproducts_bg">
 
             <div class="iproducts">
			 	<div class="iproleft">
				<div class="iplefttit">CATEGORIES</div>';
				
				$query=mysql_query('select n_id,n_name from '.$language.'_pro_class order by n_order asc');
 
		if (mysql_num_rows($query)>0){
 		while($row=mysql_fetch_array($query)){
		$content.='<div class="iproli"><a href="products-c'.$row['n_id'].'-p1.html">'.$row['n_name'].'</a></div>';

		}
 
		}
				
				 

				
				$content.='</div>
				<div class="iproright">
				<div class="iprorighttit">MAIN PRODUCTS<span><a href="products.html">MORE+</a></span></div>
			 ';
     		

		$query=mysql_query('select n_id,n_title,n_class,n_image from '.$language.'_pro order by n_id desc limit 0,8');

		if (mysql_num_rows($query)>0){
			$i=1;
			while($row=mysql_fetch_array($query)){
			if ($i % 4==0)
			{
				$content.=' <dl style="margin-right:0px;">';
				}
			else
			{
				$content.=' <dl>';
				}
			
			$content.='<dt><img src="'.$row['n_image'].'"></dt><dd><div class="p">'.$row['n_title'].'</div><a href="products-'.$row['n_id'].'.html"><div class="span"></div></a></dd></dl>';
			 $i++;
			}

		}
		
        $content.='</div>
            </div>
        </div>
		
<div class="syaboutbox">
	<div class="synewboxtit">ABOUT US</div>

<div class="syabout">

	<div class="syaboutimg"><a href="aboutus.html"><img src="'.RsField('select a_image from '.$language.'_about where a_id=2').'" /></a></div>
    <div class="syaboutright">
    	<div class="syabouttit">'.RsField('select a_name from '.$language.'_about where a_id=2').'</div>
        <div class="syabouttxt">'.RsField('select a_content from '.$language.'_about where a_id=2').'</div>
    	<div class="syaboutmore"><a href="aboutus.html"><img src="images/abmore.png" /></a></div>
    </div>
</div>
</div>  

  
 
<div class="synew">
	<div class="synewboxtit">NEWS</div>';
				
				$query=mysql_query('select n_id,n_title,n_date,k_description from '.$language.'_news  order by n_id desc limit 0,3');

				if (mysql_num_rows($query)>0){
 				while($row=mysql_fetch_array($query)){
 					 
	$content.='<div class="synewtxt">
   		 <div class="synewtxtli">
    		<div class="synewleft">
            	<span><a href="news-'.$row['n_id'].'.html">'.CutStr($row['n_title'],78).'</a></span>
                <p>'.CutStr($row['k_description'],300).'</p>
            </div>
            <div class="synewright">
            	<div class="newrighttop">'.date('m-d',strtotime($row['n_date'])).'</div>
                <div class="newrightbtm">'.date('Y',strtotime($row['n_date'])).'</div>
            </div>
   		</div>
    </div>';


				}

				}
	$content.='</div> ';
 
 
	$content.=include('html_footer.php');
	
 	

	$file=fopen($file_name,"w+");

	if (!is_writable($file_name)) die('生成文件失败：'.$file_name.' 不可写入！');

	fwrite($file,$content);

	fclose($file);

	

	echo '生成网站首页成功！';

	break;

case 2:

	$query=mysql_query('select * from '.$language.'_aboutus order by a_order,a_id');

	if (mysql_num_rows($query)==0){

		$file_name=$file_path.'aboutus.html';

		$content=include('html_header.php');	
 
		$content.=include('html_footer.php');

		$file=fopen($file_name,"w+");

		if (!is_writable($file_name)) die('生成文件失败：'.$file_name.' 不可写入！');

		fwrite($file,$content);

		fclose($file);

	}

	else{
		$ye="about";
 		while($row=mysql_fetch_array($query)){

 			$cid=$row['a_id'];
			 
			$file_name=$file_path.'aboutus-'.$row['a_id'].'.html';
			 
 
			$content=include('html_header.php');	

$content.='
		<div class="bannernei" style="background:url('.Rsfield('select b_image from '.$language.'_banner where b_id=1').') center no-repeat;"></div>
 <div class="poosition wrap">
    You Are here:  <a href="index.html"></a> > <a href="aboutus.html">About us</a> > '.$row['a_name'].'</div>
<div class="main wrap">
	<div class="main-left fl">
		<p class="news-list-top">'.$row['a_name'].'</p>	
		<div class="our-info">
        	'.$row['a_content'].'
        </div>
		
	
	</div>

	<!-- main-right BEGIN -->
    
<div class="main-right fr">
	<ul class="right-menu">
       	    <li class="on"><a href="about.html">About us</a></li>';

$html_query=mysql_query('select * from '.$language.'_aboutus order by a_order,a_id');

if (mysql_num_rows($html_query)>0){

while($html_row=mysql_fetch_array($html_query)){

	if ($html_row['a_id']==$cid)
	{
			$content.='<li class="on2"><a href="aboutus-'.$html_row['a_id'].'.html" >'.$html_row['a_name'].'</a></li>';

		}
	else
	{
			$content.='<li><a href="aboutus-'.$html_row['a_id'].'.html"  >'.$html_row['a_name'].'</a></li>';

		}

	}
 

}

		$content.='</ul>
</div>
    <!-- main-right END -->
	<div class="clear"></div>
</div>

 
<div class="b50"></div>';

			$content.=include('html_footer.php');

			$file=fopen($file_name,"w+");

			if (!is_writable($file_name)) die('生成文件失败：'.$file_name.' 不可写入！');

			fwrite($file,$content);

			fclose($file);
			 

		}

			 
	mysql_data_seek($query,0);

		$row=mysql_fetch_array($query);

		$site_name=$site_name;

		$site_keyword=$site_keyword;

		$site_description=$site_description;

		if ($site_name=='') $site_name=$row['a_name'];

		if ($site_keyword=='') $site_keyword=$row['a_name'];

		if ($site_description=='') $site_description=$row['a_name'];

		if ($row['k_name']!='') $site_name=$row['k_name'];

		if ($row['k_keyWord']!='') $site_keyword=$row['k_keyWord'];

		if ($row['k_description']!='') $site_description=$row['k_description'];

 
		$cid=$row['a_id'];

		$file_name=$file_path.'aboutus.html';

		$content=include('html_header.php');
		$content.='
		<div class="bannernei" style="background:url('.Rsfield('select b_image from '.$language.'_banner where b_id=1').') center no-repeat;"></div>
 <div class="poosition wrap">
    You Are here:  <a href="index.html"></a> > <a href="aboutus.html">About us </a> > '.$row['a_name'].'</div>
<div class="main wrap">
	<div class="main-left fl">
		<p class="news-list-top">About us</p>	
		<div class="our-info">
        	'.$row['a_content'].'
        </div>
		
	
	</div>

	<!-- main-right BEGIN -->
    
<div class="main-right fr">
	<ul class="right-menu">
       	    <li class="on"><a href="about.html">About us</a></li>';

$html_query=mysql_query('select * from '.$language.'_aboutus order by a_order,a_id');

if (mysql_num_rows($html_query)>0){

while($html_row=mysql_fetch_array($html_query)){

	if ($html_row['a_id']==$cid)
	{
			$content.='<li class="on2"><a href="aboutus-'.$html_row['a_id'].'.html" >'.$html_row['a_name'].'</a></li>';

		}
	else
	{
			$content.='<li><a href="aboutus-'.$html_row['a_id'].'.html"  >'.$html_row['a_name'].'</a></li>';

		}

	}
 

}

		$content.='</ul>
</div>
    <!-- main-right END -->
	<div class="clear"></div>
</div>

 
<div class="b50"></div>';

		$content.=include('html_footer.php');

		$file=fopen($file_name,"w+");

		if (!is_writable($file_name)) die('生成文件失败：'.$file_name.' 不可写入！');

		fwrite($file,$content);

		fclose($file);
	}

	

	echo '生成关于我们成功！';

	break;

case 3:


$ye='pro';
 	$page_size=6;

	$query=mysql_query('select * from '.$language.'_pro_class order by n_order,n_id');

	if (mysql_num_rows($query)==0){

		$file_name=$file_path.'products.html';

		$content=include('html_header.php');

 

		$content.=include('html_footer.php');

		$file=fopen($file_name,"w+");

		if (!is_writable($file_name)) die('生成文件失败：'.$file_name.' 不可写入！');

		fwrite($file,$content);

		fclose($file);

	}

	else {

		while($row=mysql_fetch_array($query)){

			$page_sql='select n_id,n_class,n_image,n_title,n_date,k_description from '.$language.'_pro where n_class='.$row['n_id'].' order by n_date desc,n_id desc';

			$page_count=GetPageCount($page_size,$page_sql);

			for ($i=1;$i<=$page_count;$i++){

				$cid=$row['n_id'];

				$file_name=$file_path.'products-c'.$row['n_id'].'-p'.$i.'.html';

				$content=include('html_header.php');
 
 
 $content=include('html_header.php');
	$content.='
<div class="bannernei" style="background:url('.Rsfield('select b_image from '.$language.'_banner where b_id=2').') center no-repeat;"></div>
<div class="poosition wrap">   You Are here: <a href="index.html">Home</a> > <a href="products.html">Products</a> > '.$row['n_name'].' </div>
<div class="main wrap">
	
    <div class="main-left fl">
    	
        <div class="b20"></div>';
	
	
				$page=$i;

				$page_number=($page-1)*$page_size;

				$query2=mysql_query($page_sql." limit $page_number,$page_size");
 
		if (mysql_num_rows($query2)==0){

			$content.=NoDatas($language);

		}

		else{

		$content.='<ul class="list-mode-pro clearfix">';

					while($row2=mysql_fetch_array($query2)){

						$content.='<li class="transition-all" style="float:left;">    
            <a href="products-'.$row2['n_id'].'.html"  class="bigImg" >
                <img class="62-Black" src="'.$row2['n_image'].'"  />
			 </a>	
 
            <h3 style="text-align:center"><a href="products-'.$row2['n_id'].'.html" >'.$row2['n_title'].'</a></h3>
         </li>';

					}

$content.='</ul>';
					
	if ($page_count>1) $content.='<div class="page" align="center">'.ShowPages('products-c'.$row['n_id'].'-p',$page,$page_count,$language).'</div>';

		}		
$content.='</div>

	<!-- main-right BEGIN -->
    
<div class="main-right fr">
	<ul class="right-menu">
        <li class="on"><a href="products.html">Products</a></li>';
			 
$html_query=mysql_query('select * from '.$language.'_pro_class order by n_order,n_id');

if (mysql_num_rows($html_query)>0){

while($html_row=mysql_fetch_array($html_query)){

	if ($html_row['n_id']==$cid)
	{
			$content.='<li class="on2"><a href="products-c'.$html_row['n_id'].'-p1.html" >'.$html_row['n_name'].'</a></li>';

		}
	else
	{
			$content.='<li><a href="products-c'.$html_row['n_id'].'-p1.html"  >'.$html_row['n_name'].'</a></li>';

		}

	}
 
 }
 $content.='</ul>
</div>
    <!-- main-right END -->
	<div class="clear"></div>
</div>
 <div class="b50"></div>';
 
  
	 
				$content.=include('html_footer.php');

				$file=fopen($file_name,"w+");

				if (!is_writable($file_name)) die('生成文件失败：'.$file_name.' 不可写入！');

				fwrite($file,$content);

				fclose($file);

			}

		}

		mysql_data_seek($query,0);

		$row=mysql_fetch_array($query);

		$cid=$row['n_id'];

		$file_name=$file_path.'products.html';

		$content=include('html_header.php');
	$content.='
<div class="bannernei" style="background:url('.Rsfield('select b_image from '.$language.'_banner where b_id=2').') center no-repeat;"></div>
<div class="poosition wrap">   You Are here: <a href="index.html">Home</a> > <a href="products.html">Products</a> > '.$row['n_name'].' </div>
<div class="main wrap">
	
    <div class="main-left fl">
    	
        <div class="b20"></div>';
		
		$page=1;

		$page_number=($page-1)*$page_size;

		$page_sql='select n_id,n_class,n_image,n_title,n_date,k_description from '.$language.'_pro where n_class='.$row['n_id'].' order by n_date desc,n_id desc';

		$page_count=GetPageCount($page_size,$page_sql);

		$query2=mysql_query($page_sql." limit $page_number,$page_size");

		if (mysql_num_rows($query2)==0){

			$content.=NoDatas($language);

		}

		else{

					$content.='<ul class="list-mode-pro clearfix">';

					while($row2=mysql_fetch_array($query2)){

						$content.='<li class="transition-all" style="float:left;">    
            <a href="products-'.$row2['n_id'].'.html"  class="bigImg" >
                <img class="62-Black" src="'.$row2['n_image'].'"  />
			 </a>	
 
            <h3 style="text-align:center"><a href="products-'.$row2['n_id'].'.html" >'.$row2['n_title'].'</a></h3>
         </li>';

					}

$content.='</ul>';
					
	if ($page_count>1) $content.='<div class="page" align="center">'.ShowPages('products-c'.$row['n_id'].'-p',$page,$page_count,$language).'</div>';

		}		
$content.='</div>

	<!-- main-right BEGIN -->
    
<div class="main-right fr">
	<ul class="right-menu">
        <li class="on"><a href="products.html">Products</a></li>
        
		';

$html_query=mysql_query('select * from '.$language.'_pro_class order by n_order,n_id');

if (mysql_num_rows($html_query)>0){

while($html_row=mysql_fetch_array($html_query)){

	if ($html_row['n_id']==$cid)
	{
			$content.='<li class="on2"><a href="products-c'.$html_row['n_id'].'-p1.html" >'.$html_row['n_name'].'</a></li>';

		}
	else
	{
			$content.='<li><a href="products-c'.$html_row['n_id'].'-p1.html"  >'.$html_row['n_name'].'</a></li>';

		}

	}
 
 }

$content.='</ul>
</div>
    <!-- main-right END -->
	<div class="clear"></div>
</div>
 <div class="b50"></div>';
 

		$content.=include('html_footer.php');

		$file=fopen($file_name,"w+");

		if (!is_writable($file_name)) die('生成文件失败：'.$file_name.' 不可写入！');

		fwrite($file,$content);

		fclose($file);



	}



	$query=mysql_query('select * from '.$language.'_pro');

	if (mysql_num_rows($query)>0){

	while($row=mysql_fetch_array($query)){

		$site_name=$row['n_title'].' - '.$site_names;

		$site_keyword=$site_keyword2;

		$site_description=$site_description2;

		if ($site_keyword=='') $site_keyword=$row['n_title'].' - '.$site_names;

		if ($site_description=='') $site_description=$row['n_title'].' - '.$site_names;

		if ($row['k_name']!='') $site_name=$row['k_name'];

		if ($row['k_keyWord']!='') $site_keyword=$row['k_keyWord'];

		if ($row['k_description']!='') $site_description=$row['k_description'];

		$class_name=RsField('select n_name from '.$language.'_pro_class where n_id='.$row['n_class']);

		$file_name=$file_path.'products-'.$row['n_id'].'.html';

		$content=include('html_header.php');

		$content.='<div class="bannernei" style="background:url('.Rsfield('select b_image from '.$language.'_banner where b_id=2').') center no-repeat;"></div>

<div class="poosition wrap">
   
   You Are here:    <a href="index.php">Home</a> > <a href="products.html">Products</a> > '.$class_name.'
   
</div>


<div class="main wrap">
	
    <div class="main-left fl">
     
  
<div class="detailMain ">
	<dl class="clearfix">

    
    <dt class="fl imgbox imgbox-Black" >        	

           <div style="display:" class="bigImg big-img-0" >

            <!--幻灯片开始-->
        <div class="pictureDIV">
          <div id="preview" class="spec-preview">
            <span class="jqzoom"><img src="'.$row['n_image'].'" /></span>
          </div>
          
        </div>
        <!--幻灯片结束-->


           
            </div>
 
               
		<dd class="fl txtbox">			
            <h1 class="title">'.$row['n_title'].'</h1>                   
            <div class="info">'.$row['n_canshu'].'</div>                   
 	
                          
		</dd>
	</dl>
</div>
<div class="b50"></div>

<div class="  detail-tab">
	<ul class="hd"><li class="on">Product Description</li></ul>
	<ul class="bd">
		<li>
			<div class="pro-info">
           
             '.$row['n_content'].'
           </div>
		 
		 
		</li>
		 
	</ul>
</div>

   
	</div>

	<!-- main-right BEGIN -->
    
<div class="main-right fr">
	<ul class="right-menu">
        <li class="on"><a href="products.html">Products</a></li>
        
       	';

$html_query=mysql_query('select * from '.$language.'_pro_class order by n_order,n_id');

if (mysql_num_rows($html_query)>0){

while($html_row=mysql_fetch_array($html_query)){

	if ($html_row['n_id']==$cid)
	{
			$content.='<li class="on2"><a href="products-c'.$html_row['n_id'].'-p1.html" >'.$html_row['n_name'].'</a></li>';

		}
	else
	{
			$content.='<li><a href="products-c'.$html_row['n_id'].'-p1.html"  >'.$html_row['n_name'].'</a></li>';

		}

	}
 
 }

$content.=' 
 
	</ul>
</div>
    <!-- main-right END -->
	<div class="clear"></div>
</div>

 
';
 

		$content.=include('html_footer.php');

		$file=fopen($file_name,"w+");

		if (!is_writable($file_name)) die('生成文件失败：'.$file_name.' 不可写入！');

		fwrite($file,$content);

		fclose($file);

	}

	}

	echo '生成产品中心成功！';

	break;

case 4:
$ye='news';
 	$page_size=12;

	$query=mysql_query('select * from '.$language.'_news_class order by n_order,n_id');

	if (mysql_num_rows($query)==0){

		$file_name=$file_path.'news.html';

		$content=include('html_header.php');

 

		$content.=include('html_footer.php');

		$file=fopen($file_name,"w+");

		if (!is_writable($file_name)) die('生成文件失败：'.$file_name.' 不可写入！');

		fwrite($file,$content);

		fclose($file);

	}

	else {

		while($row=mysql_fetch_array($query)){

			$page_sql='select n_id,n_class,n_image,n_title,n_date,k_description from '.$language.'_news where n_class='.$row['n_id'].' order by n_date desc,n_id desc';

			$page_count=GetPageCount($page_size,$page_sql);

			for ($i=1;$i<=$page_count;$i++){

				$cid=$row['n_id'];

				$file_name=$file_path.'news-c'.$row['n_id'].'-p'.$i.'.html';

				$content=include('html_header.php');
 
 
 $content=include('html_header.php');
	$content.='
<div class="bannernei" style="background:url('.Rsfield('select b_image from '.$language.'_banner where b_id=3').') center no-repeat;"></div>
<div class="poosition wrap">   You Are here: <a href="index.html">Home</a> > <a href="news.html">News</a> > '.$row['n_name'].' </div>
<div class="main wrap">
	
    <div class="main-left fl">
    	
        <div class="b20"></div>';
		
	
				$page=$i;

				$page_number=($page-1)*$page_size;

				$query2=mysql_query($page_sql." limit $page_number,$page_size");
 

		if (mysql_num_rows($query2)==0){

			$content.=NoDatas($language);

		}

		else{

					$content.='<ul class="news-list-mode">';

					while($row2=mysql_fetch_array($query2)){

						$content.=' <li>
            <h2><a href="news-'.$row2['n_id'].'.html"  >'.$row2['n_title'].'</a></h2>
                <p>'.date('Y-m-d',strtotime($row2['n_date'])).'</p>
				<div class="cont">
                  '.$row2['k_description'].'
				   </div>
                <a href="news-'.$row2['n_id'].'.html"  class="news-more">more<i class="icon-more i-inline-block"></i></a>
			</li>';

					}

$content.='</ul>';
					
	if ($page_count>1) $content.='<div class="page" align="center">'.ShowPages('news-c'.$row['n_id'].'-p',$page,$page_count,$language).'</div>';

		}		
$content.='</div>

	<!-- main-right BEGIN -->
    
<div class="main-right fr">
	<ul class="right-menu">
        <li class="on"><a href="news.php">News</a></li>';
				$page=$i;

				$page_number=($page-1)*$page_size;

				$query2=mysql_query($page_sql." limit $page_number,$page_size");

				if (mysql_num_rows($query2)==0){

					$content.=NoDatas($language);

				}

				else{

					$content.='<ul>';

					while($row2=mysql_fetch_array($query2)){

						$content.='<li><span style="float:right; font-size:12px; color:#999;">'.date('Y-m-d',strtotime($row2['n_date'])).'</span><a href="news-'.$row2['n_id'].'.html">'.$row2['n_title'].'</a></li>';

					}

$content.='</ul>';
					
	if ($page_count>1) $content.='<div id="page" style="text-align:center;padding-top:30px; ">'.ShowPages('news-c'.$row['n_id'].'-p',$page,$page_count,$language).'<div id="clear"></div>
</div>';

		}		
$content.='</ul>
</div>
    <!-- main-right END -->
	<div class="clear"></div>
</div>
 <div class="b50"></div>';
 
  
	 
				$content.=include('html_footer.php');

				$file=fopen($file_name,"w+");

				if (!is_writable($file_name)) die('生成文件失败：'.$file_name.' 不可写入！');

				fwrite($file,$content);

				fclose($file);

			}

		}

		mysql_data_seek($query,0);

		$row=mysql_fetch_array($query);

		$cid=$row['n_id'];

		$file_name=$file_path.'news.html';

		$content=include('html_header.php');
	$content.='
<div class="bannernei" style="background:url('.Rsfield('select b_image from '.$language.'_banner where b_id=3').') center no-repeat;"></div>
<div class="poosition wrap">   You Are here: <a href="index.html">Home</a> > <a href="news.html">News</a> > '.$row['n_name'].' </div>
<div class="main wrap">
	
    <div class="main-left fl">
    	
        <div class="b20"></div>';
		
		$page=1;

		$page_number=($page-1)*$page_size;

		$page_sql='select n_id,n_class,n_image,n_title,n_date,k_description from '.$language.'_news where n_class='.$row['n_id'].' order by n_date desc,n_id desc';

		$page_count=GetPageCount($page_size,$page_sql);

		$query2=mysql_query($page_sql." limit $page_number,$page_size");

		if (mysql_num_rows($query2)==0){

			$content.=NoDatas($language);

		}

		else{

					$content.='<ul class="news-list-mode">';

					while($row2=mysql_fetch_array($query2)){

						$content.=' <li>
            <h2><a href="news-'.$row2['n_id'].'.html">'.$row2['n_title'].'</a></h2>
                <p>'.date('Y-m-d',strtotime($row2['n_date'])).'</p>
				<div class="cont">
                  '.$row2['k_description'].'
				   </div>
                <a href="news-'.$row2['n_id'].'.html" class="news-more">more<i class="icon-more i-inline-block"></i></a>
			</li>';

					}

$content.='</ul>';
					
	if ($page_count>1) $content.='<div class="page" align="center">'.ShowPages('news-c'.$row['n_id'].'-p',$page,$page_count,$language).'</div>';

		}		
$content.='</div>

	<!-- main-right BEGIN -->
    
<div class="main-right fr">
	<ul class="right-menu">
        <li class="on"><a href="news.php">News</a></li>
        
		';

$html_query=mysql_query('select * from '.$language.'_news_class order by n_order,n_id');

if (mysql_num_rows($html_query)>0){

while($html_row=mysql_fetch_array($html_query)){

	if ($html_row['n_id']==$cid)
	{
			$content.='<li class="on2"><a href="news-c'.$html_row['n_id'].'-p1.html" >'.$html_row['n_name'].'</a></li>';

		}
	else
	{
			$content.='<li><a href="news-c'.$html_row['n_id'].'-p1.html"  >'.$html_row['n_name'].'</a></li>';

		}

	}
 
 }

$content.='</ul>
</div>
    <!-- main-right END -->
	<div class="clear"></div>
</div>
 <div class="b50"></div>';
 

		$content.=include('html_footer.php');

		$file=fopen($file_name,"w+");

		if (!is_writable($file_name)) die('生成文件失败：'.$file_name.' 不可写入！');

		fwrite($file,$content);

		fclose($file);



	}



	$query=mysql_query('select * from '.$language.'_news');

	if (mysql_num_rows($query)>0){

	while($row=mysql_fetch_array($query)){

		$site_name=$row['n_title'].' - '.$site_names;

		$site_keyword=$site_keyword2;

		$site_description=$site_description2;

		if ($site_keyword=='') $site_keyword=$row['n_title'].' - '.$site_names;

		if ($site_description=='') $site_description=$row['n_title'].' - '.$site_names;

		if ($row['k_name']!='') $site_name=$row['k_name'];

		if ($row['k_keyWord']!='') $site_keyword=$row['k_keyWord'];

		if ($row['k_description']!='') $site_description=$row['k_description'];

		$class_name=RsField('select n_name from '.$language.'_news_class where n_id='.$row['n_class']);

		$file_name=$file_path.'news-'.$row['n_id'].'.html';

		$content=include('html_header.php');

			$content.='
<!-- haeder S-->
<div class="bannernei" style="background:url('.Rsfield('select b_image from '.$language.'_banner where b_id=3').') center no-repeat;"></div>

<div class="poosition wrap">
   
   You Are here: <a href="index.html">Home</a> > <a href="news.html">News</a> > '.$class_name.'
   
</div>
<div class="main wrap">
	
    <div class="main-left fl">
		<div class="news-detail">
            <h1>'.$row['n_title'].'</h1>
            <p class="time">Time :'.$row['n_date'].'</p>
			<div class="cont">
             	 '.$row['n_content'].'
             </div>

		</div>
	</div>

	<!-- main-right BEGIN -->
    
<div class="main-right fr">
	<ul class="right-menu">
        <li class="on"><a href="news.php">News</a></li>
        
       ';

$html_query=mysql_query('select * from '.$language.'_news_class order by n_order,n_id');

if (mysql_num_rows($html_query)>0){

while($html_row=mysql_fetch_array($html_query)){

	if ($html_row['n_id']==$row['n_class'])
	{
			$content.='<li class="on2"><a href="news-c'.$html_row['n_id'].'-p1.html" >'.$html_row['n_name'].'</a></li>';

		}
	else
	{
			$content.='<li><a href="news-c'.$html_row['n_id'].'-p1.html"  >'.$html_row['n_name'].'</a></li>';

		}

	}
 

}

		$content.='
	</ul>
</div>
    <!-- main-right END -->
	<div class="clear"></div>
</div>

<div class="b50"></div>'; 

		$content.=include('html_footer.php');

		$file=fopen($file_name,"w+");

		if (!is_writable($file_name)) die('生成文件失败：'.$file_name.' 不可写入！');

		fwrite($file,$content);

		fclose($file);

	}

	}



	echo '生成新闻中心成功！';

	break;


case 5:
 

$ye="contact";
	$file_name=$file_path.'contact.html';

	$content=include('html_header.php');
 
 $content.='
		<div class="bannernei" style="background:url('.Rsfield('select b_image from '.$language.'_banner where b_id=4').') center no-repeat;"></div>
 <div class="poosition wrap">
    You Are here:  <a href="index.html"></a> > <a href="contact.html">Contact Us</a></div>
<div class="main wrap">
	<div class="main-left fl">
			<p class="news-list-top"> </p>	

 		<div class="our-info">
        	'.RsField('select a_content from  '.$language.'_about where a_id=1').'
        </div>
		
	
	</div>

	<!-- main-right BEGIN -->
    
<div class="main-right fr">
	<ul class="right-menu">
       	    <li class="on"><a href="about.html">About us</a></li>';

$html_query=mysql_query('select * from '.$language.'_aboutus order by a_order,a_id');

if (mysql_num_rows($html_query)>0){

while($html_row=mysql_fetch_array($html_query)){

	$content.='<li><a href="aboutus-'.$html_row['a_id'].'.html"  >'.$html_row['a_name'].'</a></li>';


	}
 

}
	$content.='<li class="on2"><a href="contact.html"  >Contact Us</a></li>';


		$content.='</ul>
</div>
    <!-- main-right END -->
	<div class="clear"></div>
</div>

 
<div class="b50"></div>';

	$content.=include('html_footer.php');

	$file=fopen($file_name,"w+");

	if (!is_writable($file_name)) die('生成文件失败：'.$file_name.' 不可写入！');

	fwrite($file,$content);

	fclose($file);



	echo '生成联系我们成功！';

	break;
   
	 
}



function ShowPages($page_filename,$page,$page_count){

		$pagestr_1='首页';

		$pagestr_2='上一页';

		$pagestr_3='下一页';

		$pagestr_4='尾页';

		$pagestr_5='跳转';

		$pagestr_6='请输入页码！';


	$str='<div class="fypage_blk">';

	if ($page_count==1){

		$str.='<div class="fypage"><span class="fypage_disabled">'.$pagestr_1.'</span><span class="fypage_disabled">'.$pagestr_2.'</span><span class="fypage_current">1</span><span class="fypage_disabled">'.$pagestr_3.'</span><span class="fypage_disabled">'.$pagestr_4.'</span></div>';

	}

	else{

		$str.='<div class="fypage">';

		$str.='<a href="'.$page_filename.'1.html" class="fypage_str">'.$pagestr_1.'</a>';

		if ($page<=1){

			$str.='<a href="'.$page_filename.'1.html" class="fypage_str">'.$pagestr_2.'</a>';

		}

		else{

			$str.='<a href="'.$page_filename.($page-1).'.html" class="fypage_str">'.$pagestr_2.'</a>';

		}

		if ($page_count<=15){

			for($i=1;$i<=$page_count;$i++){

				if ($page==$i){

					$str.='<a class="fypage_current">'.$i.'</a>';

				}

				else{

					$str.='<a href="'.$page_filename.$i.'.html">'.$i.'</a>';

				}

			}

		}

		else{

			if ($page_count-$page<=11){

				for($i=$page_count-12;$i<=$page_count;$i++){

					if ($page==$i){

						$str.='<a class="fypage_current">'.$i.'</a>';

					}

					else{

						$str.='<a href="'.$page_filename.$i.'.html">'.$i.'</a>';

					}

				}

			}

			else{

				if ($page<10){

					for($i=1;$i<=10;$i++){

						if ($i==$page){

							$str.='<a class="fypage_current">'.$i.'</a>';

						}

						else{

							$str.='<a href="'.$page_filename.$i.'.html">'.$i.'</a>';

						}

					}

				}

				if ($page % 10==0){

					for($i=$page-1;$i<=($page/10+1)*10;$i++){

						if ($i==$page_count-2) break;

						if ($i==$page){

							$str.='<a class="fypage_current">'.$i.'</a>';

						}

						else{

							$str.='<a href="'.$page_filename.$i.'.html">'.$i.'</a>';

						}

					}

				}

				if ($page>10 && $page<$page_count-2){

					$fpage=intval($page_count/10);

					for($i=1;$i<=$fpage;$i++){

						if ($page>$i*10 && $page<($i+1)*10){

							for($i2=$i*10-1;$i2<=($i+1)*10;$i2++){

								if ($page==$i2){

									$str.='<span class="fypage_current">'.$i2.'</span>';

								}

								else{

									$str.='<a href="'.$page_filename.$i2.'.html">'.$i2.'</a>';

								}

							}

							break;

						}

					}

				}

				$str.='<strong class="fypage_sl">...</strong>';

				if ($page==$page_count){

					$str.='<span class="fypage_current">'.$page_count.'</span>';

				}

				else{

					$str.='<a href="'.$page_filename.$page_count.'.html">'.$page_count.'</a>';

				}

			}

		}

		if ($page==$page_count){

			$str.='<a href="'.$page_filename.$page_count.'.html" class="fypage_str">'.$pagestr_3.'</a>';

		}



		else{

			$str.='<a href="'.$page_filename.($page+1).'.html" class="fypage_str">'.$pagestr_3.'</a>';

		}

		$str.='<a href="'.$page_filename.$page_count.'.html" class="fypage_str">'.$pagestr_4.'</a>';

 
		$str.='</div>';

	}

	$str.='</div>';

	

	return $str;

}

?>